package ludoxia.classe
{
	public class listeObjet
	{
		
		private var varRandNoRepeat:RandomPlus;
		private var tabObstacle:Vector.<obstacle>;
		private var tabBonus:Vector.<bonus>;
		
		public function listeObjet()
		{
			//varRandNoRepeat = new RandomPlus(0,10);
			tabObstacle = new Vector.<obstacle>();
			tabBonus = new Vector.<bonus>();
			
			tabObstacle.push(new obstacle("mine"));
			/* à compléter */
			
			tabBonus.push(new bonus(100,"banane"));
			/* à compléter */
		}
		
		public function getBonus():bonus{
			
			var borneMin:Number = 0;
			var borneMax:Number = tabBonus.length - 1;
			var aleatoireNumber:Number = Math.round(Math.random() * (borneMax - borneMin)) + borneMin;

			return tabBonus[aleatoireNumber];
		}
		
		public function getObstacle():obstacle{
			
			var borneMin:Number = 0;
			var borneMax:Number = tabObstacle.length - 1;
			var aleatoireNumber:Number = Math.round(Math.random() * (borneMax - borneMin)) + borneMin;

			return tabObstacle[aleatoireNumber];
		}
		
	}
}